package com.controller.lib.net

import com.controller.lib.entity.ApResult
import com.controller.lib.entity.BaseResultEntity
import com.controller.lib.entity.CommandCallbackEntity
import com.controller.lib.entity.UpdateDeviceEntity
import com.controller.lib.entity.UpgradeResultEntity
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

/**
 *    @author : GeRui
 *    date   : 2025/6/17 16:55
 *    desc   :
 *    version: 1.0
 */
interface ApiService {
  /**
   * 获取mqtt连接信息
   * */
  @GET(Api.GET_DEVICE_MQTT_MESSAGE)
  fun getDeviceMqttMessage(@Query("mac") mac:String): Call<BaseResultEntity<ApResult>>

  /**
   * 更新设备信息
   * */
  @PUT(Api.GET_DEVICE_UPDATE_MESSAGE + "{deviceId}")
  fun updateDeviceMessage(
    @Path("deviceId") userId: String,
    @Body updateMessage: UpdateDeviceEntity
  ):  Call<BaseResultEntity<String>>

  /**
   * 上报命令回执
   * */
  @POST(Api.GET_CALLBACK_COMMAND_MESSAGE)
  fun commandCallback(@Body commandCallback: CommandCallbackEntity):Call<BaseResultEntity<String>>

  /**
   * 更新设备信息
   * */
  @GET(Api.GET_DEVICE_UPDATE_VERSION_MESSAGE)
  fun checkDeviceUpdateVersion(@Query("mac") mac:String):  Call<BaseResultEntity<UpgradeResultEntity>>

}